<{include file="admin/header.html"}>
<{include file="admin/left.html"}>
<fieldset><legend><{$tpl_title}></legend>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <th scope="col">编号</th>
    <th scope="col">标题</th>
    <th scope="col">权重</th>
    <th scope="col">状态</th>
    <th scope="col">推荐</th>
    <th scope="col">操作</th>
  </tr>
<{if $results == ""}>
	<div><center><font color="red">没有找到您要的文章！</font></center></div>
<{else}>
<{foreach from=$results item=one}> 
  <tr>
    <td><{$one.cid}></td>
    <td><!--循环显示分类-->
		[<{foreach from=$select item=result}>
			<a href="<{spUrl c=post a=cate mid=$result.mid}>"><{if $one.mid == $result.mid}><{$result.name}><{/if}></a>
		<{/foreach}>]&nbsp;
		<a href="<{spUrl c=post a=edit cid=$one.cid}>"><{$one.title}>
	</td>
    <td><{$one.sort}></td>
    <td><{if $one.status == "1"}><font color='red'>显示</font><{else}>隐藏<{/if}></td>
    <td><{if $one.recommend == "1"}><font color='red'>推荐</font><{else}>普通<{/if}></td>
    <td>
		<a class="table_icon" title="修改" href="<{spUrl c=post a=edit cid=$one.cid}>"><img src="/template/admin/images/Preferences.png" alt="修改" /></a>
		<a class="table_icon" title="删除" href="javascript:void(0);" onclick="delconfirm(<{$one.cid}>,'<{$one.title}>');"><img src="/template/admin/images/Trash.png" alt="删除" /></a>
	</td>
  </tr>
<{/foreach}>
<{/if}>
</table>

<{if $pager}>
<ul class="paginator">
共有文章<{$pager.total_count}>条，共有<{$pager.total_page}>页（每页<{$pager.page_size}>条内容）：
<!--在当前页不是第一页的时候，显示前页和上一页-->
<{if $pager.current_page != $pager.first_page}>
<li><a href="<{spUrl c=post a=index page=$pager.first_page}>">前页</a></li>
<li><a href="<{spUrl c=post a=index page=$pager.prev_page}>">上一页</a></li>
<{/if}>
<!--开始循环页码，同时如果循环到当前页则不显示链接-->
<{foreach from=$pager.all_pages item=thepage}>
	<{if $thepage != $pager.current_page}>
		<li><a href="<{spUrl c=post a=index page=$thepage}>"><{$thepage}></a></li>		
	<{else}>
		<li class="current"><a href="<{spUrl c=post a=index page=$thepage}>"><{$thepage}></a></li>		
	<{/if}>
<{/foreach}>
<!--在当前页不是最后一页的时候，显示下一页和后页-->
<{if $pager.current_page != $pager.last_page}>
<li><a href="<{spUrl c=post a=index page=$pager.next_page}>">下一页</a></li>
<li><a href="<{spUrl c=post a=index page=$pager.last_page}>">后页</a></li>
<{/if}>
</ul>
<{/if}>
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<table>
	<tr>
		<td>
		<select name="cate" id="cate" onchange="MM_jumpMenu('parent',this,0)">
			<option value="<{spUrl c=post a=index}>">按分类浏览</option>
			<{foreach from=$cates item=one}>  
			<option value="<{spUrl c=post a=cate mid=$one.mid}>"><{$one.fulltitle}></option>
			<{/foreach}>
		 </select>
		</td>
	</tr>
</table>
</fieldset>
<script type="text/javascript">
function delconfirm(id,title){
	if( window.confirm("确定删除“" + title + "”？") ){
		window.location = "<{spUrl c=post a=del}>&cid=" + id;
	}
}
</script>
<{include file="admin/footer.html"}>